home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / SHELLS / SZ2 / ADEMO2.DEF < prev    next >
Text File  |  1992-08-31  |  2KB  |  62 lines

  1. .TUTORIAL - A real editor; using the [ UNIT ] keyword
  2.  
  3. Clear the Desktop before loading this file.
  4.  
  5. The first thing you'll notice is that three related files were loaded
  6. along with the definition file.  Since this program is going to be a
  7. real editor, we need some real code.
  8.  
  9.  +-INC-++-VIR-++-EVT-+
  10.  |     ||     ||     |
  11.  |     ||     ||     |
  12.  +-----++-----++-----+
  13.  +========DEF========+
  14.  |                   |
  15.  |                   |
  16.  +===================+
  17.  
  18. If SHAZAM sees any of these files in the same directory as the
  19. definition, an {$I} include statement for it is inserted in the
  20. generated application.
  21.  
  22. The *.VIR and *.EVT files are always scanned during the generate
  23. process, to extract method and event names.
  24.  
  25.                     *.INC - General purpose code.
  26.  
  27. We need a dialog to take of any error or other messages produced by
  28. the EDITORS unit/objects.
  29.  
  30.                       *.VIR - Application methods
  31.  
  32. Any type of method (usually VIRtual) can be put in the file .  In
  33. this case, we need to initialize the BUFFERS unit and set the
  34. procedure pointer from the EDITORS unit.
  35.  
  36. See the METHODS documentation for details on "Pre/Post" "Init/Done".
  37.  
  38.                       *.EVT - Application Events
  39.  
  40. Here we define the only application-level event, so we can open
  41. files.  Both the command constant (cmXX) and HandlecommanD event
  42. (hdXX) have the same name, but different prefixes (ie: Open causes a
  43. pair of matching names - the "cmOpen" symbol and "hdOpen" routine).
  44.  
  45.                          The [ UNIT ] Keyword
  46.  
  47. All you do is list unit names for the program's USES clause.  This
  48. list is also used to generate the list of units to be overlaid, and
  49. to specify whether the unit has a "RegisterUNITNAME" procedure.  (See
  50. KEYWORD section for more detail.)
  51.  
  52. @PA - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  53.  
  54.  
  55.  
  56. [ UNIT ]
  57. General /r                                       @@ Use & register
  58.  
  59. [ SUBMENU ] File        ;;file management
  60. Open                    ;;open a file            @@ *.EVT file
  61. Save                    ;;save current window    @@ EDITORS.PAS internal
  62.